home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / machserver / include / user / vmTypes.h < prev   
Encoding:
C/C++ Source or Header  |  1992-07-17  |  6.3 KB  |  190 lines

  1. /*
  2.  * vmTypes.h --
  3.  *
  4.  *    Type declarations for user VM interface.
  5.  *
  6.  * Copyright 1991 Regents of the University of California
  7.  * Permission to use, copy, modify, and distribute this
  8.  * software and its documentation for any purpose and without
  9.  * fee is hereby granted, provided that this copyright
  10.  * notice appears in all copies.  The University of California
  11.  * makes no representations about the suitability of this
  12.  * software for any purpose.  It is provided "as is" without
  13.  * express or implied warranty.
  14.  *
  15.  * $Header: /user5/kupfer/spriteserver/include/user/RCS/vmTypes.h,v 1.6 92/07/16 17:25:41 kupfer Exp $ SPRITE (Berkeley)
  16.  */
  17.  
  18. #ifndef _VMTYPESUSER
  19. #define _VMTYPESUSER
  20.  
  21. #include <sprite.h>
  22.  
  23.  
  24. /*
  25.  * The different commands to give to Vm_Cmd.  For more details on these
  26.  * options look at the man page for vmcmd.
  27.  *
  28.  *    VM_SET_CLOCK_PAGES        Set the number of pages to check on
  29.  *                    each iteration of the clock algorithm
  30.  *    VM_SET_CLOCK_INTERVAL        Set how many seconds between iterations
  31.  *                    of the clock algorithm.
  32.  *    VM_SET_MAX_DIRTY_PAGES        Set the maximum number of dirty pages
  33.  *                    to check before waiting for clean 
  34.  *                    memory.
  35.  *    VM_DO_COPY_IN            Time Vm_CopyIn.
  36.  *    VM_DO_COPY_OUT            Time Vm_CopyOut.
  37.  *    VM_DO_MAKE_ACCESS_IN        Time Vm_MakeAccessible.
  38.  *    VM_DO_MAKE_ACCESS_OUT        Time Vm_MakeAccessible.
  39.  *    VM_SET_COPY_SIZE            Set the number of bytes to move when
  40.  *                    using the previous 4 commands.
  41.  *    VM_GET_STATS            Return vm stats.
  42.  *    VM_SET_PAGEOUT_PROCS        Set the number of processes used 
  43.  *                    to clean memory.
  44.  *    VM_SET_COW            Set the flags which determines whether
  45.  *                    to use copy-on-write or not.
  46.  *    VM_COUNT_DIRTY_PAGES        Determine how many pages in memory
  47.  *                    are dirty.
  48.  *    VM_SET_FREE_WHEN_CLEAN        Set the flag which determines whether
  49.  *                    to free memory after it is cleaned.
  50.  *    VM_FLUSH_SEGMENT            Flush a segment from memory.
  51.  *    VM_SET_FS_PENALTY            Set the file system penalty .
  52.  *    VM_SET_NUM_PAGE_GROUPS        Set the number of pages groups to 
  53.  *                    divide memory into when calculating
  54.  *                    the penalty.
  55.  *    VM_SET_ALWAYS_REFUSE        Always refuse file system requests for
  56.  *                    memory.
  57.  *    VM_SET_ALWAYS_SAY_YES        Always satisfy file system request for
  58.  *                    memory if possible.
  59.  *    VM_RESET_FS_STATS            Clear out the min and max size of
  60.  *                    the file system cache kept in the
  61.  *                    vm stat structure.
  62.  *    VM_SET_COR_READ_ONLY        Set the flag which determines if pages
  63.  *                    that are copied because of copy-on-ref
  64.  *                    faults are marked read-only.
  65.  *    VM_SET_PREFETCH            Turn prefetch on or off.
  66.  *    VM_SET_USE_FS_READ_AHEAD        Say whether to use the file systems
  67.  *                    read-ahead to help out vm paging.
  68.  *    VM_START_TRACING            Start virtual memory tracing.
  69.  *    VM_END_TRACING            Stop virtual memory tracing.
  70.  *    VM_SET_WRITEABLE_PAGEOUT        Set flag which forces all writeable
  71.  *                    pages to be written out to swap when
  72.  *                    they are recycled whether they are
  73.  *                    dirty or not.
  74.  *    VM_SET_WRITEABLE_REF_PAGEOUT    Set flag which forces all writeable
  75.  *                    pages that have been referenced to be
  76.  *                    written out to swap when they are 
  77.  *                    recycled whether they are dirty or not.
  78.  *    VM_CLEAR_COUNTERS            Zero counters in Vm_Stat.
  79.  *    VM_DO_COPY_IN_INBAND        Do a test that looks like the 
  80.  *                        Vm_CopyIn test, but relies on the 
  81.  *                        MIG stub to do the data transfer.
  82.  *    VM_DO_COPY_OUT_INBAND        Ditto, but for Vm_CopyOut.
  83.  */
  84. #define VM_SET_CLOCK_PAGES        0
  85. #define VM_SET_CLOCK_INTERVAL        1
  86. #define VM_SET_MAX_DIRTY_PAGES        4
  87. #define VM_DO_COPY_IN            5
  88. #define VM_DO_COPY_OUT            6
  89. #define VM_DO_MAKE_ACCESS_IN        7
  90. #define VM_DO_MAKE_ACCESS_OUT        8
  91. #define VM_SET_COPY_SIZE        9
  92. #define VM_GET_STATS            10
  93. #define VM_SET_PAGEOUT_PROCS        11
  94. #define VM_FORCE_SWAP            12
  95. #define VM_SET_COW            13
  96. #define VM_COUNT_DIRTY_PAGES        14
  97. #define VM_SET_FREE_WHEN_CLEAN        15
  98. #define VM_FLUSH_SEGMENT        16
  99. #define VM_SET_FS_PENALTY        17
  100. #define VM_SET_NUM_PAGE_GROUPS        18
  101. #define VM_SET_ALWAYS_REFUSE        19
  102. #define VM_SET_ALWAYS_SAY_YES        20
  103. #define VM_RESET_FS_STATS        21
  104. #define VM_SET_COR_READ_ONLY        22
  105. #define VM_SET_PREFETCH            23
  106. #define VM_SET_USE_FS_READ_AHEAD    24
  107. #define VM_START_TRACING        25
  108. #define VM_END_TRACING            26
  109. #define    VM_SET_WRITEABLE_PAGEOUT    27
  110. #define    VM_SET_WRITEABLE_REF_PAGEOUT    28
  111. #define VM_CLEAR_COUNTERS        29
  112. #define VM_DO_COPY_IN_INBAND        30
  113. #define VM_DO_COPY_OUT_INBAND        31
  114.  
  115. /*
  116.  * The first allowable machine dependent command.
  117.  */
  118. #define    VM_FIRST_MACH_CMD        50
  119.  
  120. /* 
  121.  * Maximum buffer size for the VM_DO_COPY_IN and VM_DO_COPY_IN commands.
  122.  */
  123. #define VM_DO_COPY_MAX_SIZE        8192
  124.  
  125. /*
  126.  * Maximum number of segments in PCB information. (XXX Really should 
  127.  * redesign interface to allow arbitrary number of segments.)
  128.  */
  129.  
  130. #define    VM_NUM_SEGMENTS        20
  131.  
  132. /*
  133.  * The type of segment.
  134.  */
  135. #ifndef VM_SYSTEM
  136. #define VM_SYSTEM    0
  137. #define VM_CODE        1
  138. #define VM_HEAP        2
  139. #define VM_STACK    3
  140. #define VM_SHARED    4
  141. #endif
  142.  
  143.  
  144. /*
  145.  * Length of the object file name that is embedded in each segment table
  146.  * entry.
  147.  */
  148. #define    VM_OBJ_FILE_NAME_LENGTH    50
  149.  
  150. /*
  151.  * Implementation independent definition of segment ids.
  152.  */
  153.  
  154. typedef int Vm_SegmentID;
  155.  
  156. /*
  157.  * Segment information. Add any new fields to the end of the structure.
  158.  */
  159.  
  160. typedef struct Vm_SegmentInfo {
  161.     int            segNum;        /* The number of this segment. */
  162.     int         refCount;    /* Number of processes using this 
  163.                      * segment */
  164.                         /* Name of object file for code 
  165.                      * segments. */
  166.     char        objFileName[VM_OBJ_FILE_NAME_LENGTH];
  167.     int               type;        /* CODE, STACK, HEAP, or SYSTEM */
  168.     int            numPages;    /* Explained in vmInt.h. */
  169.     int            ptSize;        /* Number of pages in the page table */
  170.     int            resPages;    /* Number of pages in physical memory
  171.                      * for this segment. */
  172.     int            flags;        /* Flags to give information about the
  173.                      * segment table entry. */
  174.     int            ptUserCount;    /* The number of current users of this
  175.                      * page table. */
  176.     int            numCOWPages;    /* Number of copy-on-write pages that
  177.                      * this segment references. */
  178.     int            numCORPages;    /* Number of copy-on-ref pages that
  179.                      * this segment references. */
  180.     Address        minAddr;    /* Minimum address that the segment
  181.                      * can ever have. */
  182.     Address        maxAddr;    /* Maximium address that the segment
  183.                      * can ever have. */
  184.     int            traceTime;    /* The last trace interval that this
  185.                      * segment was active. */
  186. } Vm_SegmentInfo;
  187.  
  188.  
  189. #endif /* _VMTYPESUSER */
  190.